package com.example.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.domain.entity.Params;
import com.example.domain.entity.User;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;


import java.util.List;

@Repository
public interface UserMapper extends BaseMapper<User> {

    List<User> findBySearch(@Param("params") Params params);

    @Select("select * from user where username = #{username} limit 1")
    User findByUserName(@Param("username") String username);

    @Select("select * from user where username = #{username} and password = #{password} limit 1")
    User findByNameAndPassword(@Param("username") String username, @Param("password") String password);
}
